package com.home.zqt.platform.dao;

import com.home.zqt.platform.domain.MJAuthority;
import org.beetl.sql.core.SQLManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author soon
 * @description: TODO
 * @date 2019-06-01 12:21
 **/
@Service
public class AuthorityDao {

    @Autowired
    @Qualifier("sqlManagerProduct")
    private SQLManager sqlManagerProduct;
    @Autowired
    @Qualifier("sqlManagerPrepare")
    private SQLManager sqlManagerPrepare;
    @Autowired
    @Qualifier("sqlManagerDaily")
    private SQLManager sqlManagerDaily;

    public MJAuthority single(Long id) {
        return sqlManagerProduct.single(MJAuthority.class, id);
    }

    public List<MJAuthority> findByCodeOrName(String keyword) {
        return sqlManagerProduct.select("", MJAuthority.class, keyword);
    }

    public void updateTemplateById(MJAuthority entity) {
        sqlManagerProduct.updateTemplateById(entity);
    }
}
